class Person < ActiveRecord::Base validate :last_name_starts_with_m def last_name_starts_with_m unless last_name.downcase.start_with?('m') errors.add(:last_name, "Name must start with 'm'") end end end